package com.chyb.cloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
/*测试熔断规则*/
public class CircuitBreakerController {
    @GetMapping("/testF")
    public String testF() {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "----------testF";
    }

    @GetMapping("/testG")
    public String testG() {
        int a = 1 / 0;
        return "----------testF";
    }
}
